home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 45
/
Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso
/
Aminet
/
game
/
role
/
ldmud-3.2-bin.lha
/
mud
/
doc
/
LPC
/
inheritance
< prev
next >
Wrap
Text File
|
2001-04-06
|
758b
|
28 lines
CONCEPT
inheritance
DESCRIPTION
An object can inherit all variables and functions from another
object. This is done with the declaration 'inherit "file";'.
This must come before any local variables or functions.
An example, defining a monster:
inherit "obj/monster";
reset(arg) {
::reset(arg);
set_name("troll");
set_level(9);
set_hp(100);
set_wc(12);
set_al(-60);
set_short("A troll");
set_long("It is a nasty troll that looks very aggressive.\n");
set_aggressive(1);
}
NOTE
Nowadays, inheritance has much more things to offer.
Description will follow eventually.